package com.hlbspringcloud.signature.controller;

import com.hlbspringcloud.signature.annotation.Insert;
import com.hlbspringcloud.signature.dto.CardDto;
import com.hlbspringcloud.signature.dto.GroupCardDto;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @Author huanglibin
 * @Project signature
 * @Description
 * @Date 2021-01-04-10-06-07
 * @Version 1.0
 */
@RestController
public class UserController {
    @PostMapping("simple")
    public Object simple(@RequestBody @Valid CardDto cardDto){
        return cardDto;
    }

    @PostMapping("card_list")
    public Object cardList(@RequestBody @Valid List<CardDto> cardList){
        return cardList;
    }

    @PostMapping("insert_card")
    public Object insert_card(@RequestBody @Validated(Insert.class)GroupCardDto cardDto){
        return cardDto;
    }
}
